package com.bdk.middle.management.api.domain;

import lombok.Data;

import com.bdk.middle.common.domain.BaseDO;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

@Data
public class AdminDO extends BaseDO implements UserDetails {

    private String username;

    private String password;

    private Integer status;

    private List<String> roleIds;

    private List<RoleDO> authorities;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
